function XXt = computeCrossProducts(X)


[N D] = size(X);

Xa = ones(D, 1)*X(:)';
Xa = reshape(Xa, D*N, D)';

Xb = X';
Xb = ones(D, 1)*Xb(:)';


XXt = reshape(Xa.*Xb, D, D, N);
